import React ,{useEffect,useState}from 'react'
import axios from "axios"

function Shop() {
  const [list,setList]=useState([])
  useEffect(()=>{
      axios.get("/list").then(res=>{
        setList(res.data.list)
      })
  },[])
  
  return (
    <div>
        {
            list&&list.map((item:any,index)=>{
             //   return <Goods item={item} key={index}></Goods>
               return <div className='hezi' key={index}>
                    <img src={item.img} alt="" />
                    <p>{item.title}</p>
                    <p>￥{item.price}</p>
                </div>
            })
        }
    </div>
  )
}

export default Shop